package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.model;

public class News {

	public static final String TC_NEWS_ID = "_news_id";
	public static final String TC_RFC_ID = "rfc";
	public static final String TC_FROM = "from";
	public static final String TC_TO = "to";
	public static final String TC_TITLE = "title";
	public static final String TC_MESSAGE = "message";
	public static final String TC_KNOWN = "known";
	public static final String TC_DIVERS = "divers";

	private String message = "";
	private String title = "";
	private String fromUser = "";
	private String toUser = "";
	private String rfcID = "";
	private boolean known = false;

	public News(String from, String to, String title, String message,
			String rfcID, String unknow) {

		this.fromUser = from;
		this.toUser = to;
		this.title = title;
		this.message = message;
		this.rfcID = rfcID;
		
		if (unknow.equals("true")) {
			this.known = true;
		}else {
			this.known = false;
		}
	}

	@Override
	public String toString() {
		String newsTitle = this.rfcID + " " + message;
		if (known) {
			return newsTitle;
		} else {
			return "* " + newsTitle;
		}

	}

	public String getMessage() {
		return message;
	}

	public String getTitle() {
		return title;
	}

	public String getFromUser() {
		return fromUser;
	}

	public String getToUser() {
		return toUser;
	}

	public String getRfcID() {
		return rfcID;
	}

	public boolean isKnown() {
		return known;
	}

}
